package com.xjaq.dify.http;

import com.github.lianjiatech.retrofit.spring.boot.annotation.Intercept;
import com.github.lianjiatech.retrofit.spring.boot.annotation.RetrofitClient;
import com.xjaq.dify.entity.TextToAudioRequest;
import com.xjaq.dify.interceptor.AudioInterceptor;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
/**
 * @author LUmengqian
 */
@Intercept(handler = AudioInterceptor.class)
@RetrofitClient(baseUrl = "${dify.base-url}" , readTimeoutMs = 30000, connectTimeoutMs = 100000, writeTimeoutMs = 100000)
public interface AudioApi {
//    @Headers({"Content-Type: audio/wav"
//            ,"Authorization: Bearer ${dify.api-key}"
//            ,"Accept: text/event-stream"
//            , "Host: ${dify.host}"})
    @POST("text-to-audio")
    Call<ResponseBody> textToAudio(@Body TextToAudioRequest request);


}
